package com.service.bracelet.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.service.bracelet.common.CommonResult;
import com.service.bracelet.entity.User;

import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.Map;

/**
 * 用户服务
 */
public interface IUserService extends IService<User> {
    /**
     * 查询用户信息
     *
     * @param params
     * @return
     */
    CommonResult<List<User>> queryList(Map<String, Object> params);

    /**
     * 根据账号获取用户信息
     *
     * @param params
     * @return
     */
    User getUserByAccount(Map<String, Object> params);

    /**
     * 根据用户ID获取用户信息
     *
     * @param params
     * @return
     */
    User getUserById(Map<String, Object> params);

    /**
     * 修改用户信息
     *
     * @param params
     */
    void updateInfo(Map<String, Object> params) throws UnsupportedEncodingException, NoSuchAlgorithmException;

    /**
     * 修改密码
     *
     * @param params
     * @throws UnsupportedEncodingException
     * @throws NoSuchAlgorithmException
     */
    void updatePassword(Map<String, Object> params) throws UnsupportedEncodingException, NoSuchAlgorithmException;

    /**
     * 重置密码
     *
     * @param params
     * @throws UnsupportedEncodingException
     * @throws NoSuchAlgorithmException
     */
    void resetPassword(Map<String, Object> params) throws UnsupportedEncodingException, NoSuchAlgorithmException;

    /**
     * 注册账号
     *
     * @param params
     * @throws UnsupportedEncodingException
     * @throws NoSuchAlgorithmException
     */
    void register(Map<String, Object> params) throws UnsupportedEncodingException, NoSuchAlgorithmException;

    /**
     * 回答问题
     * @param params
     * @return
     */
    boolean answerQuestion(Map<String, Object> params) throws UnsupportedEncodingException, NoSuchAlgorithmException;
}
